import Vue from 'vue'
import VueRoter from 'vue-router'

// 懒加载
const Home = () => import('views/home/Home')
const Category = () => import('views/category/Category')
const Cart = () => import('views/cart/Cart')
const Peofile = () => import('views/peofile/Peofile')
Vue.use(VueRoter)


const routes =[
  {
    path: '',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/category',
    component: Category
  },
  {
    path: '/cart',
    component: Cart
  },
  {
    path: '/peofile',
    component: Peofile
  }
]
const router = new VueRoter({
  routes,
  mode: 'history'
})

export default router